package cn.monkey.chat.server.connect.chat.session;

import cn.monkey.chat.server.data.account.UserSession;
import com.google.gson.Gson;

import java.util.Base64;

public class SimpleTestUserSessionRepository implements UserSessionRepository {

    private final Gson gson = new Gson();

    @Override
    public UserSession findByToken(String token) {
        byte[] decode = Base64.getDecoder().decode(token);
        String s = new String(decode);
        return gson.fromJson(s, UserSession.class);
    }
}
